Logic Programming with Monads and Comprehensions

نویسندگان

  • Yves Bekkers
  • Paul Tarau
چکیده

We give a logical reconstruction of all-solution predicates in terms of list comprehensions in Prolog's and we describe a variety of logic programming constructs in terms of monads and monad morphisms. Novel monad structures are described for lazy function lists, clause unfoldings and a monad morphism based embedding of Prolog in Prolog is given.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Comprehending Ringads - For Phil Wadler, on the Occasion of his 60th Birthday

List comprehensions are a widely used programming construct, in languages such as Haskell and Python and in technologies such as Microsoft’s Language Integrated Query. They generalize from lists to arbitrary monads, yielding a lightweight idiom of imperative programming in a pure functional language. When the monad has the additional structure of a so-called ringad, corresponding to ‘empty’ and...

متن کامل

A compiler for Cada

Monads have evolved into a powerful and versatile tool for functional programming, but remain a challenging concept for those versed in other paradigms. However, their usefulness encourages us to explore means by which they can be made more accessible. While efforts have been made to introduce syntactic constructs for this purpose, such as the do-notation and monad comprehensions in Haskell, li...

متن کامل

Extensions: A Technique for Structuring Functional-Logic Programs

Monads are a technique widely used in functional programming languages to address many different problems. This paper presents extensions, a functional-logic programming technique that constitutes an alternative to monads in several situations. Extensions permit the definition of easily reusable functions in the same way as monads, but are based on simpler concepts taken from logic programming,...

متن کامل

Collection Processing with Constraints, Monads, and Folds

We propose an intermediate form based on monad-algebra comprehensions (to represent queries), folds (to represent computation), and setoids over polynomial datatypes (to represent data), suitable for use in collection processing. Such an intermediate form captures, in a uniform way, large fragments of many recent largescale collection processing languages such as MapReduce, PIG, DryadLINQ, and ...

متن کامل

On Compiling Linear Logic Programs with Comprehensions, Aggregates and Rule Priorities

Linear logic programs are challenging to implement efficiently because facts are asserted and retracted frequently. Implementation is made more difficult with the introduction of useful features such as rule priorities, which are used to specify the order of rule inference, and comprehensions or aggregates, which are mechanisms that make data iteration and gathering more intuitive. In this pape...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995